
<?php if (@$task == "detail") { 
		echo css_asset('printstyle.css' ); ?>
		
<script>
$(function(){
	$("#btnprint").click(function(){
		window.open('<?php echo base_url("../print/reportchecklist.html") ?>');
	});
});
</script>
<center><h3>Track Dokumen</h3></center>
<?php
	function getlist($str){
		$arr = explode(",",$str);
		if (count($arr) > 1){
			$hasil = "";
			foreach($arr as $ar){
				$hasil .= $ar."<br />";
			}
			return $hasil;
		}else{
			return $str;
		}
	}
?>
<table width="500px" cellspacing=0 cellpadding=0 border=0 style="border:1px solid #030;margin:auto;padding:20px">
	<tr valign="top">
		<td align="right" width="100px"><b>Kode : </b></td>
		<td><b><?php echo $data->project_code ; ?></b></td>
	</tr>
	<tr valign="top">
		<td align="right"> <b>Nama Proyek : </b></td>
		<td> <b><?php echo $data->project_name ; ?></b></td>
	</tr>
	<tr valign="top">
		<td align="right">PPB : </td>
		<td> <?php echo getlist($data->flag_ppb) ; ?></td>
	</tr>
	<tr valign="top">
		<td align="right">PDP : </td>
		<td> <?php echo getlist($data->flag_pdp) ; ?></td>
	</tr>
	<tr valign="top">
		<td align="right">PDK : </td>
		<td> <?php echo getlist($data->flag_pdk) ; ?></td>
	</tr>
	<tr valign="top">
		<td align="right">RP : </td>
		<td> <?php echo getlist($data->flag_rp) ; ?></td>
	</tr>
	<tr valign="top">
		<td align="right">RAPK : </td>
		<td> <?php echo getlist($data->flag_rapk) ; ?></td>
	</tr>
	<tr valign="top">
		<td align="right">AK : </td>
		<td> <?php echo getlist($data->flag_ak) ; ?></td>
	</tr>
	<tr valign="top">
		<td align="right">BC : </td>
		<td> <?php echo getlist($data->flag_bc) ; ?></td>
	</tr>
</table>
<?php }else{ ?>


<script>
$(function(){
	$("input[type='submit']").button();
	$.fn.getCombobox = function(data, key, label, desc){
		var field = $(this);
		field.html("<option></option>");
		$.ajax({
			url : "c_public_function",
			data : data,
			type : 'POST', dataType : 'json'
		}).done(function(response){
			for(i=0;i<response.length;i++){
				var option = "<option value='"+response[i][key]+"' ";
				if (desc != "")
					option += " alt='<div class=desc>"+response[i][desc]+"</div>'";
					
				option += " >"+response[i][label]+"</option>";
				field.append(option);
			}
				field.chosen();
				field.trigger("chosen:updated");
		});
	}
	field_project_id = $("#project_id");
	field_project_id.getCombobox({ task : "project2"},"project_id","project_name","project_code","");
	
	$("#btnCari").click(function(){
		project_id = field_project_id.val();
		$("#laporan").load("c_reportproject",{ project_id : project_id, task : 'detail' });
	});
});
</script>
<center>
	<p >&nbsp;</p>
	<table>
		<tr>
			<td>Proyek : </td>
			<td style="width:300px"> <select style="width:300px" name="project_id" id="project_id">
				<option value=""></option>
			</select></td>
		</tr>
		<tr>
			<td></td>
			<td style="width:300px"><input type="submit" value="Cari" id="btnCari"></td>
		</tr>
	</table>
</center>
	<p >&nbsp;</p>
<div id="laporan"></div>

<?php } ?>